// 原生
const http = require("http");

const app = http
  .createServer((req, res) => {
    switch (req.method) {
      case "POST": {
        if (req.url === "/user") {
          res.end(JSON.stringify({ message: "POST用户接口" }));
        }
        break;
      }
      case "GET": {
        if (req.url === "/user") {
          res.end(JSON.stringify({ message: "GET用户接口" }));
        }
        break;
      }
    }
  })
  .listen(3000);
